/* ============================================================
   MOBILE BREAKPOINT (< 480px)
   ============================================================ */
@media (max-width: 480px) {
    .header {
        padding: 14px 20px;
    }

    .logo-img {
        height: 40px;
    }

    .main-menu {
        font-size: 13px;
    }

    .main-menu li {
        margin-right: 10px;
    }

    .nav-actions {
        gap: 10px;
    }

    .theme-toggle {
        width: 18px;
        height: 18px;
    }

    .hamburger-menu {
        width: 20px;
        height: 16px;
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-4px, 6px);
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-4px, -6px);
    }

    .dropdown-menu {
        top: 55px;
        min-width: 120px;
        padding: 6px 8px;
    }

    .dropdown-menu li {
        padding: 6px 16px;
    }

    .sub-item {
        font-size: 13px;
    }

    /* Projects — 1 cột */
    .project-1,
    .project-2,
    .project-3,
    .project-4 {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 16px 20px;
        gap: 16px;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Reset height cố định, tránh tràn */
    .project-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .project-content img {
        width: 100%;
        height: auto !important;
        object-fit: cover;
    }

    .project-content h3 {
        font-size: 15px;
        margin-top: 10px;
    }

    /* Footer */
    .main-footer {
        min-height: auto;
        margin-top: 50px;
        padding-bottom: 20px;
    }

    .logo-footer {
        padding: 20px 16px 10px;
    }

    .logo-footer .logo-img {
        height: 34px;
    }

    .back-to-top {
        position: static;
        display: block;
        text-align: right;
        padding: 0 16px 10px;
        font-size: 13px;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 16px 16px;
        gap: 5px;
        font-size: 11px;
    }
}




/* ============================================================
   MOBILE BREAKPOINT (481px – 767px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 767px) {
    .header {
        padding: 16px 28px;
    }

    .logo-img {
        height: 46px;
    }

    .main-menu {
        font-size: 15px;
    }

    .main-menu li {
        margin-right: 16px;
    }

    .nav-actions {
        gap: 12px;
    }

    .theme-toggle {
        width: 20px;
        height: 20px;
    }

    .dropdown-menu {
        top: 58px;
        padding: 8px 10px;
    }

    .dropdown-menu li {
        padding: 6px 24px;
    }

    .sub-item {
        font-size: 14px;
    }

    /* Projects — 1 cột */
    .project-1,
    .project-2,
    .project-3,
    .project-4 {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 16px 28px;
        gap: 16px;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .project-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .project-content img {
        width: 100%;
        height: auto !important;
        object-fit: cover;
    }

    .project-content h3 {
        font-size: 16px;
        margin-top: 10px;
    }

    
    /* Footer */
    .main-footer {
        margin-top: 60px;
        padding-bottom: 20px;
    }

    .logo-footer {
        padding: 24px 28px 10px;
    }

    .back-to-top {
        position: static;
        display: block;
        text-align: right;
        padding: 0 28px 10px;
        font-size: 14px;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 28px 16px;
        gap: 5px;
        font-size: 12px;
    }
}




/* ============================================================
   TABLET BREAKPOINT (768px – 1023px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    .header {
        padding: 20px 40px;
    }

    .logo-img {
        height: 55px;
    }

    .main-menu {
        font-size: 18px;
    }

    .main-menu li {
        margin-right: 25px;
    }

    .nav-actions {
        gap: 18px;
    }

    .hamburger-menu {
        width: 22px;
        height: 19px;
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-4.5px, 7.5px);
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-4.5px, -7.5px);
    }

    .dropdown-menu {
        top: 65px;
        min-width: 140px;
    }

    .dropdown-menu li {
        padding: 8px 60px;
    }

    .sub-item {
        font-size: 15px;
    }

    /* Projects — 2 cột */
    .project-1,
    .project-2,
    .project-3,
    .project-4 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding: 24px 40px;
        gap: 20px;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .project-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .project-content img {
        width: 100%;
        height: 260px !important;
        object-fit: cover;
    }

    .project-content h3 {
        font-size: 18px;
    }
    
    /* Footer */
    .main-footer {
        height: 220px;
        margin-top: 80px;
    }

    .logo-footer {
        padding: 35px 40px;
    }

    .footer {
        padding: 50px 40px 0px;
    }

    .back-to-top {
        top: 35px;
        right: 40px;
        font-size: 17px;
    }
}


/* ============================================================
   DESKTOP BREAKPOINT (1024px and up)
   ============================================================ */
@media (min-width: 1024px) {
    .header {
        padding: 20px 60px;
    }

    .logo-img {
        height: 65px;
    }

    .main-menu {
        font-size: 20px;
    }

    .main-menu li {
        margin-right: 30px;
    }

    .nav-actions {
        gap: 20px;
    }

    .hamburger-menu {
        width: 24px;
        height: 20px;
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 8px);
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -8px);
    }

    .dropdown-menu {
        top: 70px;
        min-width: 150px;
    }

    .dropdown-menu li {
        padding: 8px 85px;
    }

    .sub-item {
        font-size: 16px;
    }

    /* Projects — 3 cột */
    .project-1,
    .project-2,
    .project-3,
    .project-4 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        padding: 40px 60px 20px;
        gap: 28px;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .project-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .project-content img {
        height: 420px !important;
        object-fit: cover;
    }

    .project-content h3 {
        font-size: 22px;
    }

    .main-footer {
        height: 250px;
        margin-top: 100px;
    }

    .logo-footer {
        padding: 40px 60px;
    }

    .footer {
        padding: 60px 60px 0px;
    }

    .back-to-top {
        top: 40px;
        right: 60px;
        font-size: 18px;
    }
}


/* ============================================================
   LARGE DESKTOP (1440px and up)
   ============================================================ */
@media (min-width: 1440px) {

    .header {
        padding: 20px 60px;
    }

    .logo-img {
        height: 65px;
    }

    .project-1,
    .project-2,
    .project-3,
    .project-4 {
        padding: 40px 60px 20px;
        gap: 28px;
    }

    .project-content img {
        height: 480px !important;
    }

    .project-content h3 {
        font-size: 24px;
}

    .main-footer {
        height: 250px;
        margin-top: 100px;
    }

    .logo-footer {
        padding: 40px 60px;
    }

    .footer {
        padding: 60px 60px 0px;
    }

    .back-to-top {
        top: 40px;
        right: 60px;
        font-size: 18px;
    }

}
    




/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .header,
    .hamburger-menu,
    .dropdown-menu,
    .back-to-top {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .project-1,
    .project-2,
    .project-3,
    .project-4 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .project-content img {
        height: auto !important;
        box-shadow: none;
    }

    .main-footer {
        background: #eee;
    }
}


@media (max-width: 767px) {
    .dropdown-menu {
        right: 20px; /* khớp với header padding mobile */
    }
}